package org.erepublik.company.service;

import org.erepublik.company.ECountry;
import org.erepublik.company.product.EProductAttribute;
import org.erepublik.company.product.ProductDesign;
import org.erepublik.company.searchCriteria.EAllianceSearchCriteria;
import org.erepublik.company.searchCriteria.EQualityFilter;
import org.erepublik.company.searchCriteria.EWeaponComparator;

public class WeaponSearchCriteria {

    
    public EMinDurability getDurability() {
        return durability;
    }
    public void setDurability(EMinDurability durability) {
        this.durability = durability;
    }
    public EMinStats getDamage() {
        return damage;
    }
    public void setDamage(EMinStats damage) {
        this.damage = damage;
    }
    public ECountry getCountry() {
        return country;
    }
    public void setCountry(ECountry country) {
        this.country = country;
    }
    public EWeaponType getWeaponType() {
        return weaponType;
    }
    public void setWeaponType(EWeaponType weaponType) {
        this.weaponType = weaponType;
    }
    private EWeaponComparator comparator = EWeaponComparator.SORT_BY_PRICE;
    private EMinDurability durability = EMinDurability.MIN_1;
    private EMinStats damage = EMinStats.MIN_0;   
    private ECountry country; 
    private EAllianceSearchCriteria alliance = EAllianceSearchCriteria.ALL;
    private EWeaponType weaponType = EWeaponType.TANK;
    private EQualityFilter qualityFilter = EQualityFilter.Q5;
    
    public ProductDesign getMinimalDesign() {
        ProductDesign design = new ProductDesign(weaponType.getProductType());
        design.setAttributeValue(EProductAttribute.DAMAGE, getDamage().getVal());
        design.setAttributeValue(EProductAttribute.DURABILITY, getDurability().getVal()*10);
        return design;
    }
    public void setComparator(EWeaponComparator comparator) {
        this.comparator = comparator;
    }
    public EWeaponComparator getComparator() {
        return comparator;
    }
    public void setQualityFilter(EQualityFilter qualityFilter) {
        this.qualityFilter = qualityFilter;
    }
    public EQualityFilter getQualityFilter() {
        return qualityFilter;
    }
    public void setAlliance(EAllianceSearchCriteria alliance) {
        this.alliance = alliance;
    }
    public EAllianceSearchCriteria getAlliance() {
        return alliance;
    }
    
}
